export default {
  getEvidenceCatalog: `select [data] from yx_ya_szml where id = ( select max( id ) from yx_ya_szml )`,
  delEvidenceCatalog: `delete from yx_ya_szml`,
  addEvidenceCatalog (data) {
    if (process.browser) {
      return {
        SQL: `replace into yx_ya_szml(id,data)values(1,?)`,
        parameter: {1: data}
      }
    } else {
      return [{
        SQL: `replace into yx_ya_szml(id,data)values(1,$data)`,
        Parameter: {'$data': data}
      }]
    }
  },
  updateEvidenceNode (id, data) {
    if (process.browser) {
      return [{
        SQL: `replace into yx_ya_szml(id,data)values(?,?)`,
        parameter: {1: id, 2: data}
      }]
    } else {
      return [{
        SQL: `replace into yx_ya_szml(id,data)values($id,$data)`,
        Parameter: {$id: id, $data: data}
      }]
    }
  },
  existEvidenceMaterial (param) {
    return {
      SQL: `select * from (select wjxh id from yx_dzjz_jzmlwj union all select wsbh from yx_ws_ajjzwj) where id in (${param})`
    }
  },
  getEvidenceMaterialText (param) {
    let str = `'${param.join(`','`)}'`
    return {
      SQL: `select wjxh WJID,TEXT from yx_dzjz_jzmlwj where wjxh in (${str})
      union
      select wsbh,TEXT from yx_ws_ajjzwj where wsbh in (${str})
      union
      select id,TEXT from yx_fj_wj where id in (${str})`
    }
  }
}
